namespace Antivirus.Domain.Logic.Hashers
{
    using System.IO;
    using System.Security.Cryptography;
    using Digest;

    public class Md5Hasher : IHasher
    {
        private readonly MD5 _algorythm = MD5.Create();

        public Hash Calculate(byte[] input)
        {
            return new Md5Hash(_algorythm.ComputeHash(input));
        }

        public Hash Calculate(Stream input)
        {
            return new Md5Hash(_algorythm.ComputeHash(input));
        }
    }
}